package com.yima.baseproj.module.app.teacher;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yima.baseproj.module.sys.teacher.TeacherEntity;
import com.yima.baseproj.module.sys.teacher.model.TeacherSearchAddModel;
import org.springframework.stereotype.Service;

@Service
public class AppTeacherService extends ServiceImpl<AppTeacherMapper,TeacherEntity> {

    //根据code获取教师信息
    public TeacherSearchAddModel findByCode(String teacherCode){
        return baseMapper.findByCode(teacherCode);
    }

    //根据openid获取教师信息
    public TeacherEntity findByOpenId(String teacherVxid){
        return baseMapper.selectOne(new QueryWrapper<TeacherEntity>()
                .eq("teacher_vxid",teacherVxid));
    }
}
